package net.aiion.weave.impl.xml.events;

import net.aiion.weave.spi.xml.events.NamespaceXmlEvent;

public class NamespaceXmlEventImpl extends XmlEventImpl implements NamespaceXmlEvent
{
    private final String prefix;
    private final String namespaceURI;

    public NamespaceXmlEventImpl(final String aPrefix, final String aNamespaceURI) {
        prefix = aPrefix;
        namespaceURI = aNamespaceURI;
    }

    @Override
    public int getType() {
        return NAMESPACE;
    }

    @Override
    public String getPrefix() {
        return prefix;
    }

    @Override
    public String getNamespaceURI() {
        return namespaceURI;
    }

    @Override
    public String toString() {
        final StringBuilder builder = new StringBuilder();
        builder.append("XmlNamespaceImpl[prefix=");
        builder.append(prefix);
        builder.append(", namespaceURI=");
        builder.append(namespaceURI);
        builder.append("]");
        return builder.toString();
    }
}
